import request from '@/utils/request'

// 查询请假列表
export function listBorrow(query) {
  return request({
    url: '/business/borrow/list',
    method: 'get',
    params: query
  })
}

// 查询请假详细
export function getBorrow(borrowId) {
  return request({
    url: '/business/borrow/' + borrowId,
    method: 'get'
  })
}

// 新增请假配置
export function addBorrow(data) {
  return request({
    url: '/business/borrow/save',
    method: 'post',
    data: data
  })
}

export function editBorrow(data) {
  return request({
    url: '/business/borrow/update',
    method: 'put',
    data: data
  })
}

// 删除请假配置
export function delBorrow(id) {
  return request({
    url: '/business/borrow/' + id,
    method: 'delete'
  })
}

// 启动请假流程
export function startProcess(data) {
  return request({
    url: '/business/borrow/startProcess/',
    method: 'post',
    data: data
  })
}

// 审批
export function auditBorrow(data) {
  return request({
    url: '/business/borrow/audit',
    method: 'post',
    data: data
  })
}

// 导出请假数据
export function exportBorrow(query) {
  return request({
    url: '/business/borrow/export',
    method: 'get',
    params: query
  })
}

